<template>
  <div>
    <div v-for="item in github_items" :key="item.id">
      {{item.full_name}}
    </div>
  </div>
</template>

<script>
import axios from "axios";
import {mapMutations, mapState} from "vuex";
export default {
  name: "App.vue",
  computed: {
    ...mapState(["github_items"])
  },
  methods:{
    ...mapMutations({
      upItems:'UP_ITEMS'
    })
  },
  mounted(){
    axios.get("https://api.github.com/search/repositories?q=r&sort=stars").then(value=>{
      console.log(value.data.items);
      debugger
      // this.$store.commit("UP_ITEMS",value.data.items);
      this.upItems(value.data.items)
    })
  }
}
</script>

<style scoped>


